package com.itheima.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * @author tongchen
 * @create 2022-12-19 20:13
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "servers")
@Validated
public class ServletConfig {
    private String ipAdress;
    @Max(value = 8888,message = "最大值不能超过8888")
    @Min(value = 202,message = "最小值不能超过202")
    private String port;
    private String timeout;
}
